package me.huangxiang.design_pattern.composite;

public class CompositeApp {
    public static void main(String[] args) {
        AbstractFile file1, file2, file3, file4, file5, folder1, folder2, folder3, folder4;
        folder1 = new Folder("huangxiang的资料");
        folder2 = new Folder("图像文件");
        folder3 = new Folder("文本文件");

        file1 = new TextFile("九阴真经.txt");
        file2 = new TextFile("葵花宝典.txt");
        file3 = new ImageFile("小龙女.jpg");
        file4 = new ImageFile("张无忌.jpg");

        folder1.add(folder2);
        folder1.add(folder3);

        folder2.add(file3);
        folder2.add(file4);

        folder3.add(file1);
        folder3.add(file2);

        folder1.killVirus();
    }
}
